package com.mm.learn.login;/**
 * @author wdx
 * @create 2021-09-23 10:18
 */

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author wdx
 * @date 2021年09月23日 10:18
 */
@RestController
@RequestMapping("/login")
public class LoginController {

    @Autowired
    LoginContext loginContext;

    /**
     *
     * @param username
     * @param password
     * @param loginType
     * @return
     */
    @GetMapping
    public String login(String username,String password,Integer loginType) throws InterruptedException {
//        Thread.sleep(5000);
        return loginContext.login(username,password,loginType);

    }


    @PostMapping("/alarm")
    public List<Alarm> login(@RequestBody List<Alarm> alarm){
        return alarm;

    }
}
